package Review2;

import java.util.Stack;

public class Test05 {
    public void printReversely(ListNode head){
    	if(head==null){
    		return;
    	}
    	Stack<ListNode> stack = new Stack<ListNode>();
    	ListNode pListNode =head;
    	while(pListNode!=null){
    		stack.add(pListNode);
    		pListNode = pListNode.next;
    	}
    	while(!stack.isEmpty()){
    		System.out.println(stack.pop().value);
    	}
    	
    }
}
